


export function get(config={}){
	let {
		url,
		data={}
	} = config


	return new Promise((resolve,reject)=>{
//let base='http://172.16.7.77:82'
		let base='http://172.16.7.75:82'
		url = base+url


		 uni.request({
			url,
			method:"GET",
			header:{
				'Content-Type':'application/json',
				'token':uni.getStorageSync('token')
			},
			success: res => {
				resolve(res)
			},
			fail:err=>{
				reject(err)
			}
		})
	})
}

export function post(config={}){
	let {
		url,
		data={}
	} = config


	return new Promise((resolve,reject)=>{
		let baseHost='http://172.16.7.75:82'
		url = baseHost+url
		console.log("================promise-----==================");
		console.log(url);
		uni.request({
			url,
			data,
			method:"POST",
			header:{
				'Content-Type':'application/json',
				 'token':uni.getStorageSync('token')
			},
			success: res => {
				resolve(res)
			},
			fail:err=>{
				reject(err)
			}
		})
	})
}
